import Asset from '@/utils/Asset';

function getCurrentRoute() {
    let pages = getCurrentPages();    //获取加载的页面
    let currentPage = pages[pages.length - 1];    //获取当前页面的对象
    return currentPage.route;    //当前页面url
}

export default {
    onShareAppMessage(options) {
        let appName = this.$options.store.getters.settings.wechat_weapp_name;
        return {
            title: '您的好友向您推荐了' + appName,
            path: getCurrentRoute(),
            imageUrl: Asset.image('/app/logo.png')
        };
    }
};
